# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=luakit
pkgver=2.3.3
pkgrel=1
pkgdesc="Fast, small, webkit based browser framework extensible by Lua"
url="https://luakit.github.io/"
# armv7: fails to build
# s390x: install fails
# ppc64le, riscv64: no luajit
arch="all !armv7 !ppc64le !s390x !riscv64"
license="GPL-3.0-or-later"
depends="
	gsettings-desktop-schemas
	gst-plugins-good
	lua5.1-filesystem
	lua5.1-socket
	"
makedepends="webkit2gtk-4.1-dev luajit-dev"
checkdepends="xvfb luacheck lua5.1-luassert"
options="!check bigdocs" #fixme
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/luakit/luakit/archive/refs/tags/$pkgver.tar.gz
	$pkgname-libsoup3.patch::https://github.com/luakit/luakit/commit/5bcd5bbe49c1f0031f4126a90ebc7a3e5a6cb064.diff
	split-docs.patch
	"

build() {
	make DOCDIR=/usr/share/doc/luakit PREFIX=/usr USE_LUAJIT=1 DEVELOPMENT_PATHS=0
}

check() {
	make run-tests
}

package() {
	make DOCDIR=/usr/share/doc/luakit PREFIX=/usr DESTDIR="$pkgdir" install
}

sha512sums="
ae5088541118c693db4a90f7e727d1f4094b56d4ea4cd51d2019351ff6b44672a1d7b9f80b351a37767556564b68633d815649ceaa4d8bd3b966a20a155ba2b2  luakit-2.3.3.tar.gz
acc27f0f3631ee2d86296350807c4cfcedfe4e844ce5713dac8dcb7eba50b6213631934e17b5f6bb077d54e8a8c9693df2a5c7375ced26ede26780c558feaf0f  luakit-libsoup3.patch
cbef5cbbc7fd820ba11da4886e371ccc5029c29745d22c391370d6dc1fa76b503a1d5cb535450ac8c2406d5a1aead92b7bd21ad5baf0b390455a2052765d9aec  split-docs.patch
"
